package com.yxhl.zoume.domain.interactor.car.specialcar;

import com.yxhl.zoume.data.http.repository.car.SpecialCarRepository;
import com.yxhl.zoume.data.http.rest.param.base.RequestParamImpl;
import com.yxhl.zoume.data.http.rest.param.specialcar.SpecialCarCashPayParam;
import com.yxhl.zoume.data.http.rest.response.specialcar.SpecialCarCashPayResponse;
import com.yxhl.zoume.domain.DomainConstants;
import com.yxhl.zoume.domain.interactor.base.UseCase;

import javax.inject.Inject;
import javax.inject.Named;

import rx.Observable;
import rx.Scheduler;

/**
 * Created by vhawk on 2016/10/12.
 */

public class SpecialCarCashPayUseCase extends UseCase<SpecialCarCashPayResponse> {

    private final SpecialCarRepository mSpecialCarRepository;

    @Inject
    public SpecialCarCashPayUseCase(@Named(DomainConstants.UI_THREAD) Scheduler uiThread, @Named(DomainConstants.EXECUTOR_THREAD) Scheduler executorThread, SpecialCarRepository mSpecialCarRepository) {
        super(uiThread, executorThread);
        this.mSpecialCarRepository = mSpecialCarRepository;
    }

    @Override
    protected Observable<SpecialCarCashPayResponse> buildObservable(RequestParamImpl param) {
        return mSpecialCarRepository.specialCarPayByCash((SpecialCarCashPayParam) param)
                .observeOn(uiThread)
                .subscribeOn(executorThread);
    }
}
